package MANA;
import javax.swing.*;
import java.awt.event.*;



public class Mana extends JFrame {
	private static final long serialVersionUID = 1L;
	private final int OFFSET = 0;
	public Mana() {
				//menu
				JMenuBar menubar = new JMenuBar();
				//menu file
				JMenu file = new JMenu("File");
				file.setMnemonic(KeyEvent.VK_F);

				//submenu exit
				JMenuItem eMenuItem = new JMenuItem("Exit");
				eMenuItem.setMnemonic(KeyEvent.VK_E);
				eMenuItem.setToolTipText("Exit editor");
				//add ActionListener to exit
				eMenuItem.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						System.exit(0);
					}
				});
				//submenu save
				JMenuItem sMenuItem = new JMenuItem("Save");
				sMenuItem.setMnemonic(KeyEvent.VK_S);
				sMenuItem.setToolTipText("Save document");
				sMenuItem.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						System.out.println("Saving");
					}
				});
				//submenu new
				JMenuItem nMenuItem = new JMenuItem("New game");
				nMenuItem.setMnemonic(KeyEvent.VK_N);
				nMenuItem.setToolTipText("Load new game");
				nMenuItem.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent e) {
						System.out.println("New game");
					}
				});
				
				
				//add menuitem to file
				file.add(sMenuItem);
				file.add(nMenuItem);
				file.add(eMenuItem); 
				//add file to menubar
				menubar.add(file);
				//add menubar to program
				setJMenuBar(menubar);
		
		
		Board board = new Board();
		add(board);
		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		setSize(board.getBoardWidth() + OFFSET, board.getBoardHeigth() + 2*OFFSET);
		setLocationRelativeTo(null);
		setTitle("Mana");
		setResizable(false);
		setVisible(true);
	}
	public static void main(String[] args) {
		new Mana();
	}
}
